package com.netty.tcp;

import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;

public class ServerChannelInitializer extends ChannelInitializer {

    @Override
    protected void initChannel(Channel ch) throws Exception {
        // 传输数据的解码器
        ch.pipeline().addLast(new MessageDecoder());
        // 传输数据的编码器
        ch.pipeline().addLast( new MessageEncoder());
        // 服务端收据接收处理器
        ch.pipeline().addLast(new ServerHandler());
    }
}
